<%@ include file="/html/common/init.jsp"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style type="text/css">
<!--
.titulo_campo {
	background-color: #F5F5F5;
	text-align: left;
	padding:0px 2px 0px 2px;;
}
-->
</style>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="/js/funcao.js" charset="ISO-8859-1"></script>
<script>
	function submite(){
		submitForm(document.<portlet:namespace />fm);	
	}
function submite(str){
		campo = document.<portlet:namespace />fm;
		campo.acao.value = str;
		submitForm(campo);	
	}
</script>
<body>

<form action="<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>">
				<portlet:param name="struts_action" value="/ext/cardapio/acao" />
			  </portlet:actionURL>"
	method="post" name="<portlet:namespace />fm">
<input name="acao" type="hidden" value=""/>

<table border="0">
	<tr align="right">
		<td align="right">
			<input type="button" class="portlet-form-button" value="Adicionar" onClick="submite('add');">
		</td>
	</tr>	
</table>
</form>
<br><br>
<table align="center" width="100%" border="0" cellpadding="1" cellspacing="1">
<tr><td>

<c:if test='${cardapios != null}'>
	<table align="center" width="100%" border="0" cellpadding="1" cellspacing="1">
		<tbody><tr class="portlet-section-header">
			<th class="titulo_tab" align="left">Cardapios</th>
			<th class="titulo_tab"></th>
		</tr>
		<% int cont = 1; %>
		<c:forEach var="cardapio" items="${cardapios}">
			<input type="hidden" name="id" value="<c:out value="${cardapio.id}" />" />
			<%if (cont%2 == 0) {%>
			<tr class="portlet-section-body" style="font-weight: normal;" onmouseenter="this.className = 'portlet-section-body-hover';" onmouseleave="this.className = 'portlet-section-body';">
			<% } else {%>
			<tr class="portlet-section-alternate" style="font-weight: normal;" onmouseenter="this.className = 'portlet-section-alternate-hover';" onmouseleave="this.className = 'portlet-section-alternate';">
			<% } %>
				<td>
					<a href="<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>">
				  		<portlet:param name="struts_action" value="/ext/cardapio/acao" />
				  		<portlet:param name="id_cardapio"	value="${cardapio.id}" />
				  		<portlet:param name="acao"			value="detalhar" />
			  	  		</portlet:actionURL>" method="post" name="<portlet:namespace />fm">
						<c:out value="${cardapio.nome}"/>
					</a>
				</td>
				<td align="center">
					<a href="<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>">
				  		<portlet:param name="struts_action" value="/ext/cardapio/acao" />
				  		<portlet:param name="id_cardapio"	value="${cardapio.id}" />
				  		<portlet:param name="acao"			value="edit" />
			  	  		</portlet:actionURL>" method="post" name="<portlet:namespace />fm">
						<img src="/img/edit.gif" alt="" onmousemove="ToolTip.show(event, this, '<%= LanguageUtil.get(pageContext, "action.EDIT") %>')"  /></a>
					</a>
					<a href="<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>">
				  		<portlet:param name="struts_action" value="/ext/cardapio/acao" />
				  		<portlet:param name="id_cardapio"			value="${cardapio.id}" />
				  		<portlet:param name="acao"			value="delete" />
			  	  		</portlet:actionURL>" method="post" name="<portlet:namespace />fm">
						Del
					</a>
				</td>
			</tr>
			</tr>
</tbody>
<%cont++; %>
		</c:forEach>
	</table>
</c:if>
</td></tr>
</table>
</body>

</html>